﻿using AbpApplication.AppServices;
using AbpApplication.InPut;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Identity.Client;

namespace AbpWebapi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class BaseServiceController : ControllerBase
    {

        private readonly IBaseService _baseService;
        private readonly IEssService _esService;

        public BaseServiceController(IBaseService baseService, IEssService esService)
        {
            _baseService = baseService;
            _esService = esService;
        }
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Create_Boxs(InPut_BaseService input)=>await _baseService.Create_Boxs(input);
        [HttpPost]
  
        public async Task<ApiResponse> Update_Box(InPut_BaseService2 input)=>await _baseService.Update_Box(input);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Create_Warehouses(InPut_BaseService3 input) => await _baseService.Create_Warehouses(input);
        [HttpPost]
        public async Task <ApiResponse>   test() => await _baseService.test();     
        [HttpPost]
        public async Task<ApiResponse> Update_WarehouseLines(InPut_BaseService5 inPut)=>await _baseService.Update_WarehouseLines(inPut);
        [HttpPost]
        public async Task<ApiResponse> CreateMaterialBase(InPut_BaseService7 inPut)=>await _baseService.CreateMaterialBase(inPut);
        [HttpPost]
        //[Authorize(Roles = "管理员")]
        public async Task<ApiResponse> CreateNeetOutMaterial(InPut_BaseService10 InPut) => await _baseService.CreateNeetOutMaterial(InPut);
        [HttpPost]
        public async Task<ApiResponse> Create_Inlethouses(InPut_BaseService9 input) => await _baseService.Create_Inlethouses(input);
        [HttpPost]
        public async Task<ApiResponse> Create_Inlethouse(InPut_BaseService9 input) => await _baseService.Create_Inlethouse(input);
        [HttpPost]
        public async Task<ApiResponse> GetList_InlethouesCode(string Type)=>await _baseService.GetList_InlethouesCode(Type);
        [HttpPost]
        public async Task<ApiResponse> UpdateTaskOrderState(InPut_BaseService11 InPut)=>await _baseService. UpdateTaskOrderState(InPut);
        [HttpPost]
        public async Task<ApiResponse> DeleteTaskOrder(List<string> TaskOrderCodes)=>await _baseService.DeleteTaskOrder(TaskOrderCodes); 
        [HttpPost]
        public async Task<ApiResponse> CreateLog(InPut_BaseService15 InPut)=>await _baseService.CreateLog(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> DeleteBox(InPut_BaseService8 InPut)=>await _baseService.DeleteBox(InPut);
        [HttpPost]
        public async Task<ApiResponse> DeleteMaterial(InPut_BaseService4 input)=>await _baseService.DeleteMaterial(input);
        [HttpPost]
        public async Task<ApiResponse> CreateTaskOrder(InPut_BaseService6 InPut)=>await _baseService.CreateTaskOrder(InPut);
        [HttpPost]
        public async Task<ApiResponse> RemovesMaterial(List<string> MaterialCodes)=>await _baseService.RemovesMaterial(MaterialCodes);
        [HttpPost]
        public async Task<ApiResponse> CreateTaskOrderOut(InPut_BaseService13 InPut)=>await _baseService.CreateTaskOrderOut(InPut);
        [HttpPost]
        public async Task<ApiResponse> UpdateMaterialBaserQuantity(InPut_BaseService7 inPut) => await _baseService.UpdateMaterialBaserQuantity( inPut);
        [HttpPost]
        public async Task<ApiResponse> CreateMaterialProperty(InPut_BaseService14 InPut)=>await _baseService.CreateMaterialProperty(InPut);
    }
}
